
import { NavBar, Toast } from '@nutui/nutui-react'
import { ArrowLeft, ArrowRight } from '@nutui/icons-react'
import { useLocation, useNavigate } from 'react-router-dom';
import { http } from '../../utils'
import { Switch, ConfigProvider, Cell, Button, Notify } from '@nutui/nutui-react'
import { useState } from 'react';
const ConfigPage = () => {
    const navigate = useNavigate();
    const location = useLocation();
    const handleDel = async () => {
        localStorage.removeItem('accessToken')
        localStorage.removeItem('refreshToken')
        navigate('/loginCode')
    }

    const darkTheme = {
        nutuiNavbarBackground: '#f7f7f7',
        nutuiNavbarHeight: '0.5rem',
        nutuiButtonDefaultHeight: "0.5rem",
        nutuiCellLineHeight: "0.3rem",
        nutuiCellTitleFontSize: "0.16rem"
    };
    return (
        <div style={{ backgroundColor: "#f7f7f7", height: '100vh' }}>
            <ConfigProvider theme={darkTheme}>
                <div style={{paddingTop:"0.15rem"}}>
                    <NavBar
                        back={<ArrowLeft />}
                        onBackClick={(e) => navigate('/outlet/MySelf')}
                    >
                        设置
                    </NavBar>
                </div>
                <div style={{ marginTop: "0.6rem", padding: "0 0.2rem" }}>
                    <div>
                        <Cell.Group>
                            <Cell
                                className="nutui-cell-clickable"
                                title="个人信息"
                                align="center"
                                extra={<ArrowRight />}
                                onClick={() => navigate('/outlet/selfMessage')}
                            />
                            <Cell
                                className="nutui-cell-clickable"
                                title="账号与安全"
                                extra={<ArrowRight />}
                                align="center"
                                onClick={() => navigate('/outlet/accountSafety')}
                            />
                        </Cell.Group>
                    </div>
                    <div>
                        <Cell.Group>
                            <Cell
                                className="nutui-cell-clickable"
                                title="新消息通知"
                                align="center"
                                extra={<Switch defaultChecked />}
                            />
                            <Cell
                                className="nutui-cell-clickable"
                                title="隐私管理"
                                extra={<ArrowRight />}
                                align="center"
                            />
                            <Cell
                                className="nutui-cell-clickable"
                                title="清楚本地缓存"
                                extra={<ArrowRight />}
                                align="center"
                            />
                            <Cell
                                className="nutui-cell-clickable"
                                title="关于我们"
                                extra={<ArrowRight />}
                                align="center"
                            />
                        </Cell.Group>
                    </div>
                    <Button
                        type="default"
                        color='linear-gradient(to right, #ff9600 , #fe4801)'
                        block
                        onClick={handleDel}
                    >
                        退出登录
                    </Button>
                </div>
            </ConfigProvider >

        </div >
    )
}
export default ConfigPage;




